package com.leochan.utils;

import android.util.Log;

public class DebugUtils {

	public static void printLogD(final String str) {
		Log.d("mylog", str);
	}

	public static void printLogD() {
		StringBuffer sb = new StringBuffer();

		StackTraceElement[] stacks = new Throwable().getStackTrace();
		sb.append("class: ").append(stacks[1].getClassName())
				.append("; method: ").append(stacks[1].getMethodName())
				.append("; line number: ").append(stacks[1].getLineNumber());

		Log.d("mylog", sb.toString());
	}

	public static void printLogI() {
		StringBuffer sb = new StringBuffer();

		StackTraceElement[] stacks = new Throwable().getStackTrace();
		sb.append("class: ").append(stacks[1].getClassName())
				.append("; method: ").append(stacks[1].getMethodName())
				.append("; number: ").append(stacks[1].getLineNumber());

		Log.i("mylog", sb.toString());
	}

	public static void printLogW() {
		StringBuffer sb = new StringBuffer();

		StackTraceElement[] stacks = new Throwable().getStackTrace();
		sb.append("class: ").append(stacks[1].getClassName())
				.append("; method: ").append(stacks[1].getMethodName())
				.append("; number: ").append(stacks[1].getLineNumber());

		Log.w("mylog", sb.toString());
	}

	public static void printLogE() {
		StringBuffer sb = new StringBuffer();

		StackTraceElement[] stacks = new Throwable().getStackTrace();
		sb.append("class: ").append(stacks[1].getClassName())
				.append("; method: ").append(stacks[1].getMethodName())
				.append("; number: ").append(stacks[1].getLineNumber());

		Log.e("mylog", sb.toString());
	}

	public static void printLogI(String string) {
		Log.i("mylog", string);
	}

	public static void printLogW(String string) {
		Log.w("mylog", string);
		
	}

}
